set scheme s2color

* Figure A12(a)

local nocolumns 13
local nocolumns_m1 = `nocolumns'-1
clear
local new = _N + 1
set obs `new'
gen year = 0
expand `nocolumns_m1'
gen variable = _n+1
tempfile temp0
save `temp0.dta', replace

insheet using "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\output\table_figureA12.txt", tab clear
drop if _n<=3
drop if _n>14
forval i = 2/`nocolumns'{
	replace v`i' = subinstr(v`i',"*","",.)
	replace v`i' = subinstr(v`i',"(","",.)
	replace v`i' = subinstr(v`i',")","",.)
}
destring v2-v`nocolumns', replace
gen coefficient = (v1!="")
carryforward v1, replace
tempfile temp1
save `temp1.dta', replace

keep if coefficient==1
rename v1 time
reshape long v, i(time) j(variable)
drop coefficient
rename v coefficient
tempfile temp2
save `temp2.dta', replace

use `temp1.dta', clear
keep if coefficient==0
rename v1 time
reshape long v, i(time) j(variable)
drop coefficient
rename v stderr
merge 1:1 time variable using `temp2.dta', nogen
gen lb = coefficient - 1.96*stderr
gen ub = coefficient + 1.96*stderr

gen year = .
forval i = 0/2{
	replace year = `i'+1 if time =="tau`i'"
}
forval i = 1/4{
	replace year = -(`i')+1 if time =="pre`i'"
}

replace year = year - 0.125
gen nudge = year + 0.125
gen nudge2 = year + 0.25

sort variable year
graph twoway (scatter coefficient year if variable==8, msymbol(circle) mcolor(navy)) (line coefficient year if variable==8, lcolor(navy) lwidth(medthick)) (rcap ub lb year if variable==8, lcolor(navy) lwidth(medthick)) (scatter coefficient nudge if variable==9, msymbol(diamond) mcolor(cranberry) yaxis(2)) (line coefficient nudge if variable==9, lcolor(cranberry) lpattern(longdash) lwidth(medthick) yaxis(2)) (rcap ub lb nudge if variable==9, lcolor(cranberry) lwidth(medthick) yaxis(2)) (scatter coefficient nudge2 if variable==10, msymbol(triangle) mcolor(dkorange)) (line coefficient nudge2 if variable==10, lcolor(dkorange) lpattern(dash) lwidth(medthick)) (rcap ub lb nudge2 if variable==10, lcolor(dkorange) lwidth(medthick)), graphregion(color(white)) xline(0,lwidth(5) lcolor(gs14) lstyle(solid)) ytitle("Coefficient estimate" "", size(large)) xtitle("Year relative to merger", size(large))  ylabel(-0.2(0.1)0.2, labsize(large) gmax gmin) ylabel(-0.6(0.2)0.6, labsize(large) axis(2) ) xlabel(-3 "-3" -2 "-2" -1 "-1" 0 "0" 1 "+1" 2 "+2" 3 "+3", labsize(large)) legend(order(1 "Prod{superscript:D} (LHS)" 7 "Prod{superscript:D,AT} (RHS) " 4 "Skew{superscript:D} (LHS)") size(large) pos(6) row(1) region(lcolor(black))) title("Single deal in merger event" " ", size(vlarge) color(black))
graph export "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\output\figure_A12a.pdf", replace mag(100)

********************************************************************************

* Figure A12(b)

sort variable year
graph twoway (scatter coefficient year if variable==11, msymbol(circle) mcolor(navy)) (line coefficient year if variable==11, lcolor(navy) lwidth(medthick)) (rcap ub lb year if variable==11, lcolor(navy) lwidth(medthick)) (scatter coefficient nudge if variable==12, msymbol(diamond) mcolor(cranberry) ) (line coefficient nudge if variable==12, lcolor(cranberry) lpattern(longdash) lwidth(medthick)) (rcap ub lb nudge if variable==12, lcolor(cranberry) lwidth(medthick) ) (scatter coefficient nudge2 if variable==13, msymbol(triangle) mcolor(dkorange)) (line coefficient nudge2 if variable==13, lcolor(dkorange) lpattern(dash) lwidth(medthick)) (rcap ub lb nudge2 if variable==13, lcolor(dkorange) lwidth(medthick)), graphregion(color(white)) xline(0,lwidth(5) lcolor(gs14) lstyle(solid)) ytitle("Coefficient estimate" "", size(large)) xtitle("Year relative to merger", size(large))  ylabel(-0.5(0.25)0.5, labsize(large) gmax gmin) xlabel(-3 "-3" -2 "-2" -1 "-1" 0 "0" 1 "+1" 2 "+2" 3 "+3", labsize(large)) legend(order(1 "Sales{superscript:D,max}" 4 "Sales{superscript:D,med}  " 7 "Sales{superscript:D,min} ") size(large) pos(6) row(1) region(lcolor(black))) title("Single deal in merger event" " ", size(vlarge) color(black))
graph export "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\output\figure_A12b.pdf", replace mag(100)

********************************************************************************

* Figure A12(c)

sort variable year
graph twoway (scatter coefficient year if variable==2, msymbol(circle) mcolor(navy)) (line coefficient year if variable==2, lcolor(navy) lwidth(medthick)) (rcap ub lb year if variable==2, lcolor(navy) lwidth(medthick)) (scatter coefficient nudge if variable==3, msymbol(diamond) mcolor(cranberry) yaxis(2)) (line coefficient nudge if variable==3, lcolor(cranberry) lpattern(longdash) lwidth(medthick) yaxis(2)) (rcap ub lb nudge if variable==3, lcolor(cranberry) lwidth(medthick) yaxis(2)) (scatter coefficient nudge2 if variable==4, msymbol(triangle) mcolor(dkorange)) (line coefficient nudge2 if variable==4, lcolor(dkorange) lpattern(dash) lwidth(medthick)) (rcap ub lb nudge2 if variable==4, lcolor(dkorange) lwidth(medthick)), graphregion(color(white)) xline(0,lwidth(5) lcolor(gs14) lstyle(solid)) ytitle("Coefficient estimate" "", size(large)) xtitle("Year relative to merger", size(large))  ylabel(-0.2(0.1)0.2, labsize(large) gmax gmin) ylabel(-0.4(0.2)0.4, labsize(large) axis(2) ) xlabel(-3 "-3" -2 "-2" -1 "-1" 0 "0" 1 "+1" 2 "+2" 3 "+3", labsize(large)) legend(order(1 "Prod{superscript:D} (LHS)" 7 "Prod{superscript:D,AT} (RHS) " 4 "Skew{superscript:D} (LHS)") size(large) pos(6) row(1) region(lcolor(black))) title("Multiproduct firms" " ", size(vlarge) color(black))
graph export "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\output\figure_A12c.pdf", replace mag(100)

********************************************************************************

* Figure A12(d)

sort variable year
graph twoway (scatter coefficient year if variable==5, msymbol(circle) mcolor(navy)) (line coefficient year if variable==5, lcolor(navy) lwidth(medthick)) (rcap ub lb year if variable==5, lcolor(navy) lwidth(medthick)) (scatter coefficient nudge if variable==6, msymbol(diamond) mcolor(cranberry) ) (line coefficient nudge if variable==6, lcolor(cranberry) lpattern(longdash) lwidth(medthick)) (rcap ub lb nudge if variable==6, lcolor(cranberry) lwidth(medthick) ) (scatter coefficient nudge2 if variable==7, msymbol(triangle) mcolor(dkorange)) (line coefficient nudge2 if variable==7, lcolor(dkorange) lpattern(dash) lwidth(medthick)) (rcap ub lb nudge2 if variable==7, lcolor(dkorange) lwidth(medthick)), graphregion(color(white)) xline(0,lwidth(5) lcolor(gs14) lstyle(solid)) ytitle("Coefficient estimate" "", size(large)) xtitle("Year relative to merger", size(large))  ylabel(-0.5(0.25)0.75, labsize(large) gmax gmin) xlabel(-3 "-3" -2 "-2" -1 "-1" 0 "0" 1 "+1" 2 "+2" 3 "+3", labsize(large)) legend(order(1 "Sales{superscript:D,max}" 4 "Sales{superscript:D,med}  " 7 "Sales{superscript:D,min} ") size(large) pos(6) row(1) region(lcolor(black))) title("Multiproduct firms" " ", size(vlarge) color(black))
graph export "D:\Data\Workdata\703989\FJSJ3989\CIK\replication_restat\output\figure_A12d.pdf", replace mag(100)
